﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FortuneHeaven.DAL.Base;
using FortuneHeaven.Entity.NetBar;
using Jzy.Core.Utility;

namespace FortuneHeaven.DAL.NetBar
{
    public class NetBarDAL : ServerInfoBaseDAL
    {
       

        public NetBarInfo GetInfoWithLock(int netbarID)
        {
            string sql = "select * from NetBar with(xlock) where ID=@p0";
            return dbOper.Query<NetBarInfo>(sql, netbarID).First();
        }

        public void SetStatus(IEnumerable<int> ids, int status)
        {
            string sql = "update NetBar set Status=@p0 where ID in (" + ConvertUtil.ConvertToDbStr(ids) + ")";
            dbOper.RunSql(sql, status);

        }
    }

}
